import trinity
import blue
from actorfactory.ActorFactory import RegisterFactory
from actorfactory.ActorFactory import BaseActorFactory
TEMPLATETYPE = 'SKYBOX'

class SkyBoxFactory(BaseActorFactory):

    def __init__(self):
        BaseActorFactory.__init__(self)



    def Register(self, factoryList):
        factoryList[TEMPLATETYPE] = self



    def CreateObject(self, template, vPos, vForward, vNorm, properties):
        if (template.GetClassType() == TEMPLATETYPE):
            data = trinity.Load(template.GetRes())
            self.HandleProperties(data, properties)
            return data



    def AddToScene(self, scene, obj, template):
        if (template.GetClassType() == TEMPLATETYPE):
            return True
        else:
            return False



RegisterFactory(SkyBoxFactory())

